package com.tencent.wuyanzu.action;

import org.apache.struts2.json.annotations.JSON;
import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ActionSupport;
import com.tencent.wuyanzu.model.Init;
import com.tencent.wuyanzu.service.InitService;
import com.tencent.wuyanzu.service.TestService;

public class InitAction extends ActionSupport{
	
	@Autowired
	private InitService initService;
	
	@Autowired
	private TestService testService;
	
	private Init init;
	
	@Override
	public String execute() throws Exception {
		init=new Init();
		init.setUid(initService.createUser());
		init.setFood(initService.provideTestFoods());
		return super.execute();
	}

	@JSON(serialize = true)
	public Init getInit() {
		return init;
	}	
	

}
